package com.boy.commonutils.config;

import com.boy.base.Setting;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author whd
 * @date 2024/06/03 11:14:43
 */
@Component
public class MinIOConfig {
    @Autowired
    private Setting setting;
    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .endpoint(setting.getEndpoint())
                .credentials(setting.getUser(), setting.getPassword())
                .build();
    }
}
